<template>
	<view class="content">
		<view class="topbak" :style="{ height: sH +10+ 'px' }">

		</view>
		<navigator hover-class="none" class="nav-box" open-type="navigateBack">
			<u-icon name="arrow-left" color="#000000" label-color="#000000" :size="20" :label-size="18"
				label="我的钱包"></u-icon>
		</navigator>
		<view class="bag_bg flex-col justify-around">
			<view class="bg_o">
				我的佣金(元)
			</view>
			<view class="bg_t">
				{{info.my_commission||0.00}}
			</view>
			<view class="bg_h flex">
				<view class="">
					可提现 ￥{{info.withdrawable||0.00}}
				</view>
				<view class="" style="margin-left: 150rpx">
					已提现 ￥{{info.withdrawn||0.00}}
				</view>
			</view>
			<image src="@/static/积分图标 1.png" mode="widthFix" style="width: 144rpx;" class="img2"></image>
		</view>
		<view class="idcard flex items-center justify-between" @click="show=true">
			<view class="" style="font-size: 28rpx;color: #333A47;">
				提现至
			</view>
			<view class="flex-center">
				<input type="text" v-model="val" placeholder="请选择"
					style="text-align: right;font-size: 28rpx;color: #00091A;font-weight: bold;margin-right: 8rpx;" />
				<image src="@/static/right.png" mode="widthFix" style="width: 32rpx;"></image>
			</view>
		</view>
		<view class="txt">
			<view class="title">
				提现金额
			</view>
			<view class="flex items-center" style="border-bottom:1px solid #F7F7F7;padding-bottom:20rpx;">
				<view class="f1" style="font-weight: bold;font-size: 52rpx;color: #00091A;">
					￥
				</view>
				<view class="f6">
					<input type="number" v-model="myyj" placeholder="请输入提现金额"/>
				</view>
				<view class="f2" style="" style="font-size: 28rpx;color: #3377FF;" @click="myyj = info.withdrawable">
					全部提现
				</view>
			</view>
		</view>
		<view class="txje flex-center" @click="submit">
			确认提现
		</view>
		<u-picker :show="show" :columns="columns" @cancel="show=false" @confirm="confirm" keyName="bankname"></u-picker>

		<image src="@/static/logo.png" mode="widthFix" style="position: absolute;bottom: 17px; width: 690rpx;">
		</image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sH: 0,
				info: '',
				val: '',
				myyj: '',
				vallist: '',
				infot: [],
				show: false,
				columns: [
					[]
				],
			}
		},
		onLoad() {
			this.getWinTop().then(res => {
				this.sH = res.statusBar;
			});
			
		},
onShow() {
	this.my_wallet()
	this.getlist()
},
		methods: {
			submit(){
				if (!this.val) {
					this.$msg.msg('请选择银行卡')
					return;
				}
				if (!this.myyj) {
					this.$msg.msg('请输入提现金额')
					return;
				}
				
				this.$api.rider_withdrawal({
					money:this.myyj,
					store_bank_id:this.vallist.id
				}).then(res => {
				this.$msg.msg(res.msg)
				})
			},
			// all() {
			// 	console.log('aaa',this.info.my_commission);
			// 	this.myyj = this.info.my_commission
			// },
			getlist() {
				this.$api.my_bank({}).then(res => {
					const convertToColumns = (array) => {
						return [array.map(item => item)];
					};
					this.columns = convertToColumns(res.data);
					console.log(this.columns);
				})
			},
			my_wallet() {
				this.$api.my_wallet({

				}).then(res => {
					this.info = res.data
				})
			},
			cancel(e) {
				this.show = false
			},
			confirm(e) {
				console.log('confirm', e)
				this.vallist = e.value[0]
				this.val = e.value[0].bankname + '(' + e.value[0].after + ')'
				this.show = false
			},
		}
	}
</script>

<style lang="scss">
	.txje {
		width: 686rpx;
		height: 100rpx;
		background: #3377FF;
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.3);
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		position: fixed;
		bottom: 100rpx;
		font-size: 32rpx;
		color: #FFFFFF;
	}

	.idcard {
		margin: 24rpx 0;
		padding: 32rpx 24rpx;
		width: 686rpx;
		height: 108rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
		border-radius: 24rpx 24rpx 24rpx 24rpx;
	}

	.txt {
		padding: 32rpx 24rpx;
		width: 686rpx;
		height: 232rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
		border-radius: 24rpx 24rpx 24rpx 24rpx;

		.title {
			font-size: 28rpx;
			color: #333A47;
			margin-bottom: 40rpx;
		}
	}

	.pop {
		width: 686rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding-bottom: 30rpx;

		.title {
			font-weight: bold;
			font-size: 32rpx;
			color: #00091A;
			margin: 40rpx 0;
			text-align: center;
		}

		.con {
			padding: 0 32rpx;
			font-size: 28rpx;
			color: #00091A;
		}

		.btn {
			width: 622rpx;
			height: 100rpx;
			background: #3377FF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			font-size: 32rpx;
			color: #FFFFFF;
			margin: 0 auto;
			margin-top: 50rpx;
		}
	}

	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.nav-box {
			width: 100%;
		}

		.bag_bg {
			padding-left: 40rpx;
			margin-top: 40rpx;
			position: relative;
			background: url('@/static/Group.png');
			background-size: cover;
			width: 686rpx;
			height: 320rpx;

			.img2 {
				top: 40rpx;
				right: 64rpx;
				position: absolute;
			}

			.bg_o {
				font-size: 28rpx;
				color: #FFFFFF;
			}

			.bg_t {
				font-size: 52rpx;
				color: #FFFFFF;
			}

			.bg_h {
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
	}
</style>